/**
 * 右侧导航
 */
define(function (require) {
    'use strict';
    var $ = require('jquery');
    var NavManager = require('/static_public/public_menu/navManager');
    require('/static_public/js/token');

    return {
        init: function () {
            new NavManager($('#nav'), [
                {
                    'id': 'menu_project',
                    'code': '',
                    'name': '返回掌上售楼处',
                    'level': 1,
                    'iconCls': 'icon-return',
                    'url': ['/page/palm_sales/index.shtml'],
                    'children': null
                },
                {
                    'id': 'user_management',
                    'code': '',
                    'name': '认筹理财',
                    'level': 1,
                    'iconCls': 'icon-finance',
                    'url': '',
                    'children': [
                        {
                            'id': 'role_authorization',
                            'code': '502101',
                            'name': '认筹活动管理',
                            'level': 2,
                            'url': ['/page/raise_finance/activities.shtml']
                        },
                        {
                            'id': 'org_management',
                            'code': '502102',
                            'name': '认筹订单管理',
                            'level': 2,
                            'url': ['/page/raise_finance/orders.shtml']
                        },
                        {
                            'id': 'org_management',
                            'code': '502103',
                            'name': '店铺管理',
                            'level': 2,
                            'url': ['/page/raise_finance/banners.shtml']
                        }
                    ]
                }
            ]);
            //限时60天免费（8月17号前）
            if(Date.parse(new Date().toDateString()) - Date.parse('2015/8/17') < 0) {
                $('.icon-finance').parent().append('<em class="tag tag-time-limit" title="限时60天免费"></em>');
            }

        }
    };
});
